#!/usr/bin/env r

## script to start the Redis job queue

## usage: 'registerDoRedis.r queue'
trim <- function(line) gsub("(^ +)|( +$)", "", line)

Sys.sleep(15)

queueString <- trim(as.character(argv[1]))

cat("registerDoRedis.r has been called. The queuename is", queueString, "\n")

lib.loc <- "/home/ubuntu/R/library"
require( doRedis, lib.loc )

# start the workers
registerDoRedis(queueString)

